/*
 * MonomialProcedure.java
 *
 * Created on May 4, 2005, 7:27 PM
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */

package com.milowski.monos.scheme;

import java.util.*;

import gnu.mapping.*;
import gnu.lists.*;
import com.milowski.monos.*;
import com.milowski.monos.monomial.*;

/**
 *
 * @author R. Alexander Milowski
 */
public class List2LexOrderProcedure extends Procedure1
{
   
   /** Creates a new instance of MonomialProcedure */
   public List2LexOrderProcedure()
   {
      super("list->lex-order");
   }
   
   public Object apply1(Object obj1) {
      LexOrder order = new LexOrder();
      LList list = (LList)obj1;
      for (Enumeration varEnum = list.elements(); varEnum.hasMoreElements(); ) {
         order.add(varEnum.nextElement().toString());
      }
      return order;
   }
   
}
